Constants
Pascal
C/C++
w
const
w
size = 100;
w
pi = 3.14159;
w
first = ‘A’;
w
filename = ‘A.DAT’;
w
#define size 100
w
#define pi 3.14159
w
#define first ‘A’
w
#define filename “A.DAT”
w
ANSI C and C++ only
w
const int size=100;
w
const float pi=3.14159;
w
const char first = ‘A’;
w
const char
filename[]=“A.DAT”;
In C (but not C++), an integer constant declared this way may NOT be used to specify the size of an array in most cases.